Ext.define('PackageManager.store.PackageStoreFull', {
    extend: 'Ext.data.Store',
    model: 'PackageManager.model.PackageModelFull',
    autoLoad: true,
    autoSync: true,
    proxy: {
        type: 'ajax',
        api: {
            read: window.location.href + '/fullpackage/read',
            update: window.location.href + '/fullpackage/update'
        },
        writer: {
            type: 'json'
        }
    },
    onProxyLoad: function(aOperation) {
        var iResult = aOperation.resultSet.records;
        this.add(iResult);
        var score = this.first();
        Ext.StoreManager.lookup('PackageStore').add(score);
        var cstore = Ext.StoreManager.lookup('ComponentStore');
        score.components().each(function(component) {
            cstore.add(component);
        });
        Ext.StoreManager.lookup('StaticDataStore').data = score.staticDatas().data;
        Ext.getCmp('griddy').getView().refresh();
    }
});